IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace > EntityScalarAsyncExtensions Class > FirstOrDefault Method : FirstOrDefault<TSource>(IEntityScalarQuery<TSource>) Method |
'Declaration
<ExtensionAttribute()> Public Overloads Shared Function FirstOrDefault(Of TSource)( _ ByVal source As IEntityScalarQuery(Of TSource) _ ) As Task(Of TSource)
'Usage
Dim source As IEntityScalarQuery(Of TSource) Dim value As Task(Of TSource) value = EntityScalarAsyncExtensions.FirstOrDefault(Of TSource)(source)
[Extension()] public static Task<TSource> FirstOrDefault<TSource>( IEntityScalarQuery<TSource> source )
public async void AsyncFirstOrDefault() { Employee emp = await _entityManager.Employees.AsScalarAsync().FirstOrDefault(); }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2